package com.example.controller;
import com.example.service.GoodsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/*
@description:超卖问题
@ClassName GoodsController
@author chen
@create 2025-06-10 17:24
@Version 1.0
*/
@Slf4j
@RestController
@RequestMapping("/goods")
public class GoodsController
{
    @Resource
    private GoodsService goodsService;

    @GetMapping("/placeOrder1")
    public String placeOrder1() throws InterruptedException
    {
        this.goodsService.placeOrder1();
        return "ok";
    }



    @GetMapping("/placeOrder2")
    public String placeOrder2() throws InterruptedException
    {
        this.goodsService.placeOrder2();
        return "ok";
    }


    @GetMapping("/placeOrder3")
    public String placeOrder3() throws InterruptedException
    {
        this.goodsService.placeOrder3();
        return "ok";
    }



    @GetMapping("/placeOrder4")
    public String placeOrder4() throws InterruptedException
    {
        this.goodsService.placeOrder4();
        return "ok";
    }
}
